function Layzr(a){this._lastScroll=0,this._ticking=!1,a=a||{},this._optionsContainer=document.querySelector(a.container)||window,this._optionsSelector=a.selector||"[data-layzr]",this._optionsAttr=a.attr||"data-layzr",this._optionsAttrSrcSet=a.attrSrcSet||"data-layzr-srcset",this._optionsAttrRetina=a.retinaAttr||"data-layzr-retina",this._optionsAttrBg=a.bgAttr||"data-layzr-bg",this._optionsAttrHidden=a.hiddenAttr||"data-layzr-hidden",this._optionsThreshold=a.threshold||0,this._optionsBefore=a.before||null,this._optionsAfter=a.after||null,this._optionsCallback=a.callback||null,this._retina=window.devicePixelRatio>1,this._srcAttr=this._retina?this._optionsAttrRetina:this._optionsAttr,this._nodes=document.querySelectorAll(this._optionsSelector),this._handlerBind=this._requestScroll.bind(this),this._create()}function simple_tooltip(a,b){jQuery(a).each(function(a){jQuery("body").append("
"+jQuery(this).find("span.tooltip-c").html()+"
");var c=jQuery("#"+b+a);jQuery(this).removeAttr("title").mouseover(function(){c.css({opacity:1,display:"none"}).fadeIn(400)}).mousemove(function(a){var b,d,e=jQuery(window).scrollTop(),f=jQuery(window).width(),g=15;b=f-30>=c.width()+a.pageX?a.pageX+g:f-c.width()-g,d=e+30>=a.pageY-c.height()?e+g:a.pageY-c.height()-33,c.css({left:b,top:d})}).mouseout(function(){c.css({left:"-9999px"})})})}jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(1-Math.pow(2,-10*b/e))+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(2-Math.pow(2,-10*--b))+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(0==b)return c;if(1==(b/=e))return c+d;if(g||(g=.3*e),h=b-f&&d<=c+f&&!a.hasAttribute(this._optionsAttrHidden)},Layzr.prototype._reveal=function(a){var b=a.getAttribute(this._srcAttr)||a.getAttribute(this._optionsAttr),c=this;if("function"==typeof this._optionsCallback){a.addEventListener?a.addEventListener("load",function(){c._optionsCallback.call(a)}):a.attachEvent("onload",function(){c._optionsCallback.call(a)})}"function"==typeof this._optionsBefore&&this._optionsBefore.call(a),a.hasAttribute(this._optionsAttrBg)?a.style.backgroundImage="url("+b+")":(b&&a.setAttribute("src",b),a.hasAttribute(this._optionsAttrSrcSet)&&a.setAttribute("srcset",a.getAttribute(this._optionsAttrSrcSet))),"function"==typeof this._optionsAfter&&this._optionsAfter.call(a),a.removeAttribute(this._optionsAttr),a.removeAttribute(this._optionsAttrSrcSet),a.removeAttribute(this._optionsAttrRetina),a.removeAttribute(this._optionsAttrBg),a.removeAttribute(this._optionsAttrHidden)},Layzr.prototype.updateSelector=function(){this._nodes=document.querySelectorAll(this._optionsSelector)},Layzr.prototype.update=function(){for(var a=this._nodes.length,b=0;b0,window.requestAnimationFrame&&(d.raf=window.requestAnimationFrame,d.caf=window.cancelAnimationFrame),d.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled,!d.pointerEvent){var f=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var g=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);g&&g.length>0&&(g=parseInt(g[1],10))>=1&&g<8&&(d.isOldIOSPhone=!0)}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(i<4.4&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|opera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;n<4;n++){c=m[n];for(var o=0;o<3;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;hb-1?a-b:a<0?b+a:a},za={},Aa=function(a,b){return za[a]||(za[a]=[]),za[a].push(b)},Ba=function(a){var b=za[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;df.currItem.fitRatio?wa||(ic(f.currItem,!1,!0),wa=!0):wa&&(ic(f.currItem),wa=!1)),Ea(ca,na.x,na.y,q))},Ga=function(a){a.container&&Ea(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ha=function(a,b){b[C]=s+a+"px, 0px"+t},Ia=function(a,b){if(!g.loop&&b){var c=k+(ra.x*pa-a)/ra.x,d=Math.round(a-pb.x);(c<0&&d>0||c>=Yb()-1&&d<0)&&(a=pb.x+d*g.mainScrollEndFriction)}pb.x=a,Ha(a,l)},Ja=function(a,b){var c=qb[a]-qa[a];return ma[a]+la[a]+c-c*(b/r)},Ka=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},La=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Ma=null,Na=function(){Ma&&(e.unbind(document,"mousemove",Na),e.addClass(a,"pswp--has_mouse"),g.mouseUsed=!0,Ba("mouseUsed")),Ma=setTimeout(function(){Ma=null},100)},Oa=function(){e.bind(document,"keydown",f),L.transform&&e.bind(f.scrollWrap,"click",f),g.mouseUsed||e.bind(document,"mousemove",Na),e.bind(window,"resize scroll orientationchange",f),Ba("bindEvents")},Pa=function(){e.unbind(window,"resize scroll orientationchange",f),e.unbind(window,"scroll",p.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Na),L.transform&&e.unbind(f.scrollWrap,"click",f),T&&e.unbind(window,n,f),clearTimeout(M),Ba("unbindEvents")},Qa=function(a,b){var c=ec(f.currItem,oa,a);return b&&(ba=c),c},Ra=function(a){return a||(a=f.currItem),a.initialZoomLevel},Sa=function(a){return a||(a=f.currItem),a.w>0?g.maxSpreadZoom:1},Ta=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=Ja(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Fa=function(){if(ca){var a=ca,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=na.x+"px",a.top=na.y+"px"}}},Va=function(a){var b="";g.escKey&&27===a.keyCode?b="close":g.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Wa=function(a){a&&(W||V||da||R)&&(a.preventDefault(),a.stopPropagation())},Xa=function(){f.setScrollOffset(0,e.getScrollY())},Ya={},Za=0,$a=function(a){Ya[a]&&(Ya[a].raf&&G(Ya[a].raf),Za--,delete Ya[a])},_a=function(a){Ya[a]&&$a(a),Ya[a]||(Za++,Ya[a]={})},ab=function(){for(var a in Ya)Ya.hasOwnProperty(a)&&$a(a)},bb=function(a,b,c,d,e,f,g){var h,i=Ca();_a(a);var j=function(){if(Ya[a]){if((h=Ca()-i)>=d)return $a(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),Ya[a].raf=F(j)}};j()},cb={shout:Ba,listen:Aa,viewportSize:oa,options:g,isMainScrollAnimating:function(){return da},getZoomLevel:function(){return q},getCurrentIndex:function(){return k},isDragging:function(){return T},isZooming:function(){return $},setScrollOffset:function(a,b){qa.x=a,K=qa.y=b,Ba("updateScrollOffset",qa)},applyZoomPan:function(a,b,c,d){na.x=b,na.y=c,q=a,Fa(d)},init:function(){if(!h&&!i){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),H=a.className,h=!0,L=e.detectFeatures(),F=L.raf,G=L.caf,C=L.transform,J=L.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),l=f.container.style,f.itemHolders=w=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],w[0].el.style.display=w[2].el.style.display="none",Ua(),p={resize:f.updateSize,orientationchange:function(){clearTimeout(M),M=setTimeout(function(){oa.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:Xa,keydown:Va,click:Wa};var d=L.isOldIOSPhone||L.isOldAndroid||L.isMobileOpera;for(L.animationName&&L.transform&&!d||(g.showAnimationDuration=g.hideAnimationDuration=0),c=0;c=Yb())&&(k=0),f.currItem=Xb(k),(L.isOldIOSPhone||L.isOldAndroid)&&(ta=!1),a.setAttribute("aria-hidden","false"),g.modal&&(ta?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===K&&(Ba("initialLayout"),K=I=e.getScrollY());var j="pswp--open ";for(g.mainClass&&(j+=g.mainClass+" "),g.showHideOpacity&&(j+="pswp--animate_opacity "),j+=E?"pswp--touch":"pswp--notouch",j+=L.animationName?" pswp--css_animation":"",j+=L.svg?" pswp--svg":"",e.addClass(a,j),f.updateSize(),m=-1,sa=null,c=0;c<3;c++)Ha((c+m)*ra.x,w[c].el.style);J||e.bind(f.scrollWrap,o,f),Aa("initialZoomInEnd",function(){f.setContent(w[0],k-1),f.setContent(w[2],k+1),w[0].el.style.display=w[2].el.style.display="block",g.focus&&a.focus(),Oa()}),f.setContent(w[1],k),f.updateCurrItem(),Ba("afterInit"),ta||(u=setInterval(function(){Za||T||$||q!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),e.addClass(a,"pswp--visible")}},close:function(){h&&(h=!1,i=!0,Ba("close"),Pa(),$b(f.currItem,null,!0,f.destroy))},destroy:function(){Ba("destroy"),Tb&&clearTimeout(Tb),a.setAttribute("aria-hidden","true"),a.className=H,u&&clearInterval(u),e.unbind(f.scrollWrap,o,f),e.unbind(window,"scroll",f),vb(),ab(),za=null},panTo:function(a,b,c){c||(a>ba.min.x?a=ba.min.x:aba.min.y?b=ba.min.y:b=3&&(m+=sa+(sa>0?-3:3),c=3);for(var d=0;d0?(b=w.shift(),w[2]=b,m++,Ha((m+2)*ra.x,b.el.style),f.setContent(b,k-c+d+1+1)):(b=w.pop(),w.unshift(b),m--,Ha(m*ra.x,b.el.style),f.setContent(b,k+c-d-1-1));if(ca&&1===Math.abs(sa)){var e=Xb(x);e.initialZoomLevel!==q&&(ec(e,oa),ic(e),Ga(e))}sa=0,f.updateCurrZoomItem(),x=k,Ba("afterChange")}}},updateSize:function(b){if(!ta&&g.modal){var c=e.getScrollY();if(K!==c&&(a.style.top=c+"px",K=c),!b&&va.x===window.innerWidth&&va.y===window.innerHeight)return;va.x=window.innerWidth,va.y=window.innerHeight,a.style.height=va.y+"px"}if(oa.x=f.scrollWrap.clientWidth,oa.y=f.scrollWrap.clientHeight,Xa(),ra.x=oa.x+Math.round(oa.x*g.spacing),ra.y=oa.y,Ia(ra.x*pa),Ba("beforeResize"),void 0!==m){for(var d,h,i,j=0;j<3;j++)d=w[j],Ha((j+m)*ra.x,d.el.style),i=k+j-1,g.loop&&Yb()>2&&(i=ya(i)),h=Xb(i),h&&(v||h.needsUpdate||!h.bounds)?(f.cleanSlide(h),f.setContent(d,i),1===j&&(f.currItem=h,f.updateCurrZoomItem(!0)),h.needsUpdate=!1):-1===d.index&&i>=0&&f.setContent(d,i),h&&h.container&&(ec(h,oa),ic(h),Ga(h));v=!1}r=q=f.currItem.initialZoomLevel,ba=f.currItem.bounds,ba&&(na.x=ba.center.x,na.y=ba.center.y,Fa(!0)),Ba("resize")},zoomTo:function(a,b,c,d,f){b&&(r=q,qb.x=Math.abs(b.x)-na.x,qb.y=Math.abs(b.y)-na.y,Ka(ma,na));var g=Qa(a,!1),h={};Ta("x",g,h,a),Ta("y",g,h,a);var i=q,j={x:na.x,y:na.y};La(h);var k=function(b){1===b?(q=a,na.x=h.x,na.y=h.y):(q=(a-i)*b+i,na.x=(h.x-j.x)*b+j.x,na.y=(h.y-j.y)*b+j.y),f&&f(b),Fa(1===b)};c?bb("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},db={},eb={},fb={},gb={},hb={},ib=[],jb={},kb=[],lb={},mb=0,nb=ka(),ob=0,pb=ka(),qb=ka(),rb=ka(),sb=function(a,b){return a.x===b.x&&a.y===b.y},tb=function(a,b){return Math.abs(a.x-b.x)<25&&Math.abs(a.y-b.y)<25},ub=function(a,b){return lb.x=Math.abs(a.x-b.x),lb.y=Math.abs(a.y-b.y),Math.sqrt(lb.x*lb.x+lb.y*lb.y)},vb=function(){X&&(G(X),X=null)},wb=function(){T&&(X=F(wb),Mb())},xb=function(){return!("fit"===g.scaleMode&&q===f.currItem.initialZoomLevel)},yb=function(a,b){return!(!a||a===document)&&!(a.getAttribute("class")&&a.getAttribute("class").indexOf("pswp__scroll-wrap")>-1)&&(b(a)?a:yb(a.parentNode,b))},zb={},Ab=function(a,b){return zb.prevent=!yb(a.target,g.isClickableElement),Ba("preventDragEvent",a,b,zb),zb.prevent},Bb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Cb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Db=function(a,b,c){if(a-O>50){var d=kb.length>2?kb.shift():{};d.x=b,d.y=c,kb.push(d),O=a}},Eb=function(){var a=na.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(oa.y/2))},Fb={},Gb={},Hb=[],Ib=function(a){for(;Hb.length>0;)Hb.pop();return D?(ja=0,ib.forEach(function(a){0===ja?Hb[0]=a:1===ja&&(Hb[1]=a),ja++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Hb[0]=Bb(a.touches[0],Fb),a.touches.length>1&&(Hb[1]=Bb(a.touches[1],Gb))):(Fb.x=a.pageX,Fb.y=a.pageY,Fb.id="",Hb[0]=Fb),Hb},Jb=function(a,b){var c,d,e,h,i=na[a]+b[a],j=b[a]>0,k=pb.x+b.x,l=pb.x-jb.x;return c=i>ba.min[a]||iba.min[a]&&(c=g.panEndFriction,ba.min[a]-i,d=ba.min[a]-ma[a]),(d<=0||l<0)&&Yb()>1?(h=k,l<0&&k>jb.x&&(h=jb.x)):ba.min.x!==ba.max.x&&(e=i)):(i0)&&Yb()>1?(h=k,l>0&&kf.currItem.fitRatio&&(na[a]+=b[a]*c)):(void 0!==h&&(Ia(h,!0),Y=h!==jb.x),ba.min.x!==ba.max.x&&(void 0!==e?na.x=e:Y||(na.x+=b.x*c)),void 0!==h)},Kb=function(a){if(!("mousedown"===a.type&&a.button>0)){if(Wb)return void a.preventDefault();if(!S||"mousedown"!==a.type){if(Ab(a,!0)&&a.preventDefault(),Ba("pointerDown"),D){var b=e.arraySearch(ib,a.pointerId,"id");b<0&&(b=ib.length),ib[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Ib(a),d=c.length;Z=null,ab(),T&&1!==d||(T=fa=!0,e.bind(window,n,f),Q=ia=ga=R=Y=W=U=V=!1,ea=null,Ba("firstTouchStart",c),Ka(ma,na),la.x=la.y=0,Ka(gb,c[0]),Ka(hb,gb),jb.x=ra.x*pa,kb=[{x:gb.x,y:gb.y}],O=N=Ca(),Qa(q,!0),vb(),wb()),!$&&d>1&&!da&&!Y&&(r=q,V=!1,$=U=!0,la.y=la.x=0,Ka(ma,na),Ka(db,c[0]),Ka(eb,c[1]),Cb(db,eb,rb),qb.x=Math.abs(rb.x)-na.x,qb.y=Math.abs(rb.y)-na.y,_=aa=ub(db,eb))}}},Lb=function(a){if(a.preventDefault(),D){var b=e.arraySearch(ib,a.pointerId,"id");if(b>-1){var c=ib[b];c.x=a.pageX,c.y=a.pageY}}if(T){var d=Ib(a);if(ea||W||$)Z=d;else if(pb.x!==ra.x*pa)ea="h";else{var f=Math.abs(d[0].x-gb.x)-Math.abs(d[0].y-gb.y);Math.abs(f)>=10&&(ea=f>0?"h":"v",Z=d)}}},Mb=function(){if(Z){var a=Z.length;if(0!==a)if(Ka(db,Z[0]),fb.x=db.x-gb.x,fb.y=db.y-gb.y,$&&a>1){if(gb.x=db.x,gb.y=db.y,!fb.x&&!fb.y&&sb(Z[1],eb))return;Ka(eb,Z[1]),V||(V=!0,Ba("zoomGestureStarted"));var b=ub(db,eb),c=Rb(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ia=!0);var d=1,e=Ra(),h=Sa();if(c1&&(d=1),c=e-d*(e/3);else c>h&&(d=(c-h)/(6*e),d>1&&(d=1),c=h+d*e);d<0&&(d=0),_=b,Cb(db,eb,nb),la.x+=nb.x-rb.x,la.y+=nb.y-rb.y,Ka(rb,nb),na.x=Ja("x",c),na.y=Ja("y",c),Q=c>q,q=c,Fa()}else{if(!ea)return;if(fa&&(fa=!1,Math.abs(fb.x)>=10&&(fb.x-=Z[0].x-hb.x),Math.abs(fb.y)>=10&&(fb.y-=Z[0].y-hb.y)),gb.x=db.x,gb.y=db.y,0===fb.x&&0===fb.y)return;if("v"===ea&&g.closeOnVerticalDrag&&!xb()){la.y+=fb.y,na.y+=fb.y;var k=Eb();return R=!0,Ba("onVerticalDrag",k),Da(k),void Fa()}Db(Ca(),db.x,db.y),W=!0,ba=f.currItem.bounds;var l=Jb("x",fb);l||(Jb("y",fb),La(na),Fa())}}},Nb=function(a){if(L.isOldAndroid){if(S&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(S),S=setTimeout(function(){S=0},600))}Ba("pointerUp"),Ab(a,!1)&&a.preventDefault();var b;if(D){var c=e.arraySearch(ib,a.pointerId,"id");if(c>-1)if(b=ib.splice(c,1)[0],navigator.pointerEnabled)b.type=a.pointerType||"mouse";else{var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}}var h,i=Ib(a),j=i.length;if("mouseup"===a.type&&(j=0),2===j)return Z=null,!0;1===j&&Ka(hb,i[0]),0!==j||ea||da||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Ba("touchRelease",a,b));var k=-1;if(0===j&&(T=!1,e.unbind(window,n,f),vb(),$?k=0:-1!==ob&&(k=Ca()-ob)),ob=1===j?Ca():-1,h=-1!==k&&k<150?"zoom":"swipe",$&&j<2&&($=!1,1===j&&(h="zoomPointerUp"),Ba("zoomGestureEnded")),Z=null,W||V||da||R)if(ab(),P||(P=Ob()),P.calculateSwipeSpeed("x"),R){var l=Eb();if(lf.currItem.fitRatio&&Pb(P))}},Ob=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){kb.length>1?(a=Ca()-O+50,b=kb[kb.length-2][d]):(a=Ca()-N,b=hb[d]),c.lastFlickOffset[d]=gb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(na[a]>ba.min[a]?c.backAnimDestination[a]=ba.min[a]:na[a]30&&(i||b.lastFlickOffset.x>20)?d=-1:h<-30&&(i||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(k+=d,k<0?(k=g.loop?Yb()-1:0,j=!0):k>=Yb()&&(k=g.loop?0:Yb()-1,j=!0),j&&!g.loop||(sa+=d,pa-=d,c=!0));var l,m=ra.x*pa,n=Math.abs(m-pb.x);return c||m>pb.x==b.lastFlickSpeed.x>0?(l=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,l=Math.min(l,400),l=Math.max(l,250)):l=333,mb===k&&(c=!1),da=!0,Ba("mainScrollAnimStart"),bb("mainScroll",pb.x,m,l,e.easing.cubic.out,Ia,function(){ab(),da=!1,mb=-1,(c||mb!==k)&&f.updateCurrItem(),Ba("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Rb=function(a){return 1/aa*a*r},Sb=function(){var a=q,b=Ra(),c=Sa();qc&&(a=c);var d,g=ha;return ga&&!Q&&!ia&&q1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=E,p[y]=Kb,p[z]=Lb,p[A]=Nb,B&&(p[B]=p[A]),L.touch&&(o+=" mousedown",n+=" mousemove mouseup",p.mousedown=p[y],p.mousemove=p[z],p.mouseup=p[A]),E||(g.allowPanToNext=!1)}}});var Tb,Ub,Vb,Wb,Xb,Yb,Zb,$b=function(b,c,d,h){Tb&&clearTimeout(Tb),Wb=!0,Vb=!0;var i;b.initialLayout?(i=b.initialLayout,b.initialLayout=null):i=g.getThumbBoundsFn&&g.getThumbBoundsFn(k);var l=d?g.hideAnimationDuration:g.showAnimationDuration,m=function(){$a("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Da(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Ba("initialZoom"+(d?"OutEnd":"InEnd"))),h&&h(),Wb=!1};if(!l||!i||void 0===i.x)return Ba("initialZoom"+(d?"Out":"In")),q=b.initialZoomLevel,Ka(na,b.initialPosition),Fa(),a.style.opacity=d?0:1,Da(1),void(l?setTimeout(function(){m()},l):m());!function(){var c=j,h=!f.currItem.src||f.currItem.loadError||g.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(q=i.w/b.w,na.x=i.x,na.y=i.y-I,f[h?"template":"bg"].style.opacity=.001,Fa()),_a("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),h&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Tb=setTimeout(function(){if(Ba("initialZoom"+(d?"Out":"In")),d){var f=i.w/b.w,g={x:na.x,y:na.y},j=q,k=ha,n=function(b){1===b?(q=f,na.x=i.x,na.y=i.y-K):(q=(f-j)*b+j,na.x=(i.x-g.x)*b+g.x,na.y=(i.y-K-g.y)*b+g.y),Fa(),h?a.style.opacity=1-b:Da(k-b*k)};c?bb("initialZoom",0,1,l,e.easing.cubic.out,n,m):(n(1),Tb=setTimeout(m,l+20))}else q=b.initialZoomLevel,Ka(na,b.initialPosition),Fa(),Da(1),h?a.style.opacity=1:Da(1),Tb=setTimeout(m,l+20)},d?25:90)}()},_b={},ac=[],bc={index:0,errorMsg:'',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Ub.length}},cc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},dc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((_b.x-b)/2),d.center.y=Math.round((_b.y-c)/2)+a.vGap.top,d.max.x=b>_b.x?Math.round(_b.x-b):d.center.x,d.max.y=c>_b.y?Math.round(_b.y-c)+a.vGap.top:d.center.y,d.min.x=b>_b.x?0:d.center.x,d.min.y=c>_b.y?a.vGap.top:d.center.y},ec=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Ba("parseVerticalMargin",a)),_b.x=b.x,_b.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=_b.x/a.w,f=_b.y/a.h;a.fitRatio=e1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=cc())}if(!c)return;return dc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=cc(),a.initialPosition=a.bounds.center,a.bounds},fc=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,ic(b,d,b===f.currItem&&wa),c.appendChild(d),g&&setTimeout(function(){
b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},gc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},hc=function(a,b){if(a.src&&a.loadError&&a.container)return b&&(a.container.innerHTML=""),a.container.innerHTML=g.errorMsg.replace("%url%",a.src),!0},ic=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},jc=function(){if(ac.length){for(var a,b=0;b=0,e=Math.min(c[0],Yb()),h=Math.min(c[1],Yb());for(b=1;b<=(d?h:e);b++)f.lazyLoadItem(k+b);for(b=1;b<=(d?e:h);b++)f.lazyLoadItem(k-b)}),Aa("initialLayout",function(){f.currItem.initialLayout=g.getThumbBoundsFn&&g.getThumbBoundsFn(k)}),Aa("mainScrollAnimComplete",jc),Aa("initialZoomInEnd",jc),Aa("destroy",function(){for(var a,b=0;b=0&&void 0!==Ub[a]&&Ub[a]},allowProgressiveImg:function(){return g.forceProgressiveLoading||!E||g.mouseUsed||screen.width>1200},setContent:function(a,b){g.loop&&(b=ya(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,i=f.getItemAt(b);if(!i)return void(a.el.innerHTML="");Ba("gettingData",b,i),a.index=b,a.item=i;var j=i.container=e.createEl("pswp__zoom-wrap");if(!i.src&&i.html&&(i.html.tagName?j.appendChild(i.html):j.innerHTML=i.html),hc(i),ec(i,oa),!i.src||i.loadError||i.loaded)i.src&&!i.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=i.src,ic(i,d),fc(0,i,j,d));else{if(i.loadComplete=function(c){if(h){if(a&&a.index===b){if(hc(c,!0))return c.loadComplete=c.img=null,ec(c,oa),Ga(c),void(a.index===k&&f.updateCurrZoomItem());c.imageAppended?!Wb&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):L.transform&&(da||Wb)?ac.push({item:c,baseDiv:j,img:c.img,index:b,holder:a,clearPlaceholder:!0}):fc(0,c,j,c.img,0,!0)}c.loadComplete=null,c.img=null,Ba("imageLoadComplete",b,c)}},e.features.transform){var l="pswp__img pswp__img--placeholder";l+=i.msrc?"":" pswp__img--placeholder--blank";var m=e.createEl(l,i.msrc?"img":"");i.msrc&&(m.src=i.msrc),ic(i,m),j.appendChild(m),i.placeholder=m}i.loading||gc(i),f.allowProgressiveImg()&&(!Vb&&L.transform?ac.push({item:i,baseDiv:j,img:i.img,index:b,holder:a}):fc(0,i,j,i.img,0,!0))}Vb||b!==k?Ga(i):(ca=j.style,$b(i,d||i.img)),a.el.innerHTML="",a.el.appendChild(j)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var kc,lc={},mc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};xa("Tap",{publicMethods:{initTap:function(){Aa("firstTouchStart",f.onTapStart),Aa("touchRelease",f.onTapRelease),Aa("destroy",function(){lc={},kc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(kc),kc=null)},onTapRelease:function(a,b){if(b&&!W&&!U&&!Za){var c=b;if(kc&&(clearTimeout(kc),kc=null,tb(c,lc)))return void Ba("doubleTap",c);if("mouse"===b.type)return void mc(a,b,"mouse");if("BUTTON"===a.target.tagName.toUpperCase()||e.hasClass(a.target,"pswp__single-tap"))return void mc(a,b);Ka(lc,c),kc=setTimeout(function(){mc(a,b),kc=null},300)}}}});var nc;xa("DesktopZoom",{publicMethods:{initDesktopZoom:function(){J||(E?Aa("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){nc={};var c="wheel mousewheel DOMMouseScroll";Aa("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Aa("unbindEvents",function(){nc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),q<1?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Aa("resize",g),Aa("afterChange",g),Aa("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Aa("pointerUp",h),b||g()},handleMouseWheel:function(a){if(q<=f.currItem.fitRatio)return g.modal&&(!g.closeOnScroll||Za||T?a.preventDefault():C&&Math.abs(a.deltaY)>2&&(j=!0,f.close())),!0;if(a.stopPropagation(),nc.x=0,"deltaX"in a)1===a.deltaMode?(nc.x=18*a.deltaX,nc.y=18*a.deltaY):(nc.x=a.deltaX,nc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(nc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?nc.y=-.16*a.wheelDeltaY:nc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;nc.y=a.detail}Qa(q,!0);var b=na.x-nc.x,c=na.y-nc.y;(g.modal||b<=ba.min.x&&b>=ba.max.x&&c<=ba.min.y&&c>=ba.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:oa.x/2+qa.x,y:oa.y/2+qa.y};var c=g.getDoubleTapZoom(!0,f.currItem),d=q===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var oc,pc,qc,rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac={history:!0,galleryUID:1},Bc=function(){return yc.hash.substring(1)},Cc=function(){oc&&clearTimeout(oc),qc&&clearTimeout(qc)},Dc=function(){var a=Bc(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c-1&&(uc=uc.split("&gid=")[0],uc=uc.split("?gid=")[0]),Aa("afterChange",f.updateURL),Aa("unbindEvents",function(){e.unbind(window,"hashchange",f.onHashChange)});var a=function(){tc=!0,wc||(xc?history.back():uc?yc.hash=uc:zc?history.pushState("",document.title,yc.pathname+yc.search):yc.hash=""),Cc()};Aa("unbindEvents",function(){j&&a()}),Aa("destroy",function(){tc||a()}),Aa("firstUpdate",function(){k=Dc().pid});var b=uc.indexOf("pid=");b>-1&&(uc=uc.substring(0,b),"&"===uc.slice(-1)&&(uc=uc.slice(0,-1))),setTimeout(function(){h&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Bc()===uc?(wc=!0,void f.close()):void(rc||(sc=!0,f.goTo(Dc().pid),sc=!1))},updateURL:function(){Cc(),sc||(vc?oc=setTimeout(Ec,800):Ec())}}}),e.extend(f,cb)}}),function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipeUI_Default=b()}(this,function(){"use strict";return function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=!1,x=!0,y=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(a,b){return a.title?(b.children[0].innerHTML=a.title,!0):(b.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return a.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return a.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},A=function(a){if(r)return!0;a=a||window.event,q.timeToIdle&&q.mouseUsed&&!k&&K();for(var c,d,e=a.target||a.srcElement,f=e.getAttribute("class")||"",g=0;g-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!(!c.href||!c.hasAttribute("download")&&(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),1))},H=function(){for(var a,b,c,d,e,f="",g=0;g"+a.label+"",q.parseShareButtonOut&&(f=q.parseShareButtonOut(a,f));i.children[0].innerHTML=f,i.children[0].onclick=G},I=function(a){for(var c=0;c=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&b<.9?(v.hideControls(),a=!0):a&&!x&&b>.9&&v.showControls()}),l("zoomGestureEnded",function(){(a=!1)&&!x&&v.showControls()})},S=[{name:"caption",option:"captionEl",onInit:function(a){e=a}},{name:"share-modal",option:"shareEl",onInit:function(a){i=a},onTap:function(){F()}},{name:"button--share",option:"shareEl",onInit:function(a){h=a},onTap:function(){F()}},{name:"button--zoom",option:"zoomEl",onTap:a.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(a){g=a}},{name:"button--close",option:"closeEl",onTap:a.close},{name:"button--arrow--left",option:"arrowEl",onTap:a.prev},{name:"button--arrow--right",option:"arrowEl",onTap:a.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){c.isFullscreen()?c.exit():c.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(a){m=a}}],T=function(){var a,c,e,f=function(d){if(d)for(var f=d.length,g=0;g-1&&(q[e.option]?(b.removeClass(a,"pswp__element--disabled"),e.onInit&&e.onInit(a)):b.addClass(a,"pswp__element--disabled"))}};f(d.children);var g=b.getChildByClass(d,"pswp__top-bar");g&&f(g.children)};v.init=function(){b.extend(a.options,z,!0),q=a.options,d=b.getChildByClass(a.scrollWrap,"pswp__ui"),l=a.listen,R(),l("beforeChange",v.update),l("doubleTap",function(b){var c=a.currItem.initialZoomLevel;a.getZoomLevel()!==c?a.zoomTo(c,b,333):a.zoomTo(q.getDoubleTapZoom(!1,a.currItem),b,333)}),l("preventDragEvent",function(a,b,c){var d=a.target||a.srcElement;d&&d.getAttribute("class")&&a.type.indexOf("mouse")>-1&&(d.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(d.tagName))&&(c.prevent=!1)}),l("bindEvents",function(){b.bind(d,"pswpTap click",A),b.bind(a.scrollWrap,"pswpTap",v.onGlobalTap),a.likelyTouchDevice||b.bind(a.scrollWrap,"mouseover",v.onMouseOver)}),l("unbindEvents",function(){y||F(),t&&clearInterval(t),b.unbind(document,"mouseout",L),b.unbind(document,"mousemove",K),b.unbind(d,"pswpTap click",A),b.unbind(a.scrollWrap,"pswpTap",v.onGlobalTap),b.unbind(a.scrollWrap,"mouseover",v.onMouseOver),c&&(b.unbind(document,c.eventK,v.updateFullscreen),c.isFullscreen()&&(q.hideAnimationDuration=0,c.exit()),c=null)}),l("destroy",function(){q.captionEl&&(f&&d.removeChild(f),b.removeClass(e,"pswp__caption--empty")),i&&(i.children[0].onclick=null),b.removeClass(d,"pswp__ui--over-close"),b.addClass(d,"pswp__ui--hidden"),v.setIdle(!1)}),q.showAnimationDuration||b.removeClass(d,"pswp__ui--hidden"),l("initialZoomIn",function(){q.showAnimationDuration&&b.removeClass(d,"pswp__ui--hidden")}),l("initialZoomOut",function(){b.addClass(d,"pswp__ui--hidden")}),l("parseVerticalMargin",P),T(),q.shareEl&&h&&i&&(y=!0),D(),Q(),M(),N()},v.setIdle=function(a){k=a,C(d,"ui--idle",a)},v.update=function(){x&&a.currItem?(v.updateIndexIndicator(),q.captionEl&&(q.addCaptionHTMLFn(a.currItem,e),C(e,"caption--empty",!a.currItem.title)),w=!0):w=!1,y||F(),D()},v.updateFullscreen=function(d){d&&setTimeout(function(){a.setScrollOffset(0,b.getScrollY())},50),b[(c.isFullscreen()?"add":"remove")+"Class"](a.template,"pswp--fs")},v.updateIndexIndicator=function(){q.counterEl&&(g.innerHTML=a.getCurrentIndex()+1+q.indexIndicatorSep+q.getNumItemsFn())},v.onGlobalTap=function(c){c=c||window.event;var d=c.target||c.srcElement;if(!r)if(c.detail&&"mouse"===c.detail.pointerType){if(I(d))return void a.close();b.hasClass(d,"pswp__img")&&(1===a.getZoomLevel()&&a.getZoomLevel()<=a.currItem.fitRatio?q.clickToCloseNonZoomable&&a.close():a.toggleDesktopZoom(c.detail.releasePoint))}else if(q.tapToToggleControls&&(x?v.hideControls():v.showControls()),q.tapToClose&&(b.hasClass(d,"pswp__img")||I(d)))return void a.close()},v.onMouseOver=function(a){a=a||window.event;var b=a.target||a.srcElement;C(d,"ui--over-close",I(b))},v.hideControls=function(){b.addClass(d,"pswp__ui--hidden"),x=!1},v.showControls=function(){x=!0,w||v.update(),b.removeClass(d,"pswp__ui--hidden")},v.supportsFullscreen=function(){var a=document;return!!(a.exitFullscreen||a.mozCancelFullScreen||a.webkitExitFullscreen||a.msExitFullscreen)},v.getFullscreenAPI=function(){var b,c=document.documentElement,d="fullscreenchange";return c.requestFullscreen?b={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:d}:c.mozRequestFullScreen?b={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+d}:c.webkitRequestFullscreen?b={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+d}:c.msRequestFullscreen&&(b={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),b&&(b.enter=function(){return j=q.closeOnScroll,q.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?a.template[this.enterK]():void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},b.exit=function(){return q.closeOnScroll=j,document[this.exitK]()},b.isFullscreen=function(){return document[this.elementK]}),b}}}),jQuery(document).ready(function(a){a(".twentytwenty-container").length>0&&(a.fn.twentytwenty=function(b){var b=a.extend({default_offset_pct:.5,orientation:"horizontal",navigation_follow:!1},b);return this.each(function(){var c=b.default_offset_pct,d=a(this),e=b.orientation,f="vertical"===e?"down":"left",g="vertical"===e?"up":"right",h=b.navigation_follow;d.wrap("");var i=d.find("img:first"),j=d.find("img:last"),k=i.attr("title"),l=j.attr("title");d.append("");var m=d.find(".twentytwenty-handle");m.append(""),m.append(""),d.addClass("twentytwenty-container"),i.addClass("twentytwenty-before"),j.addClass("twentytwenty-after"),void 0!==k&&k&&k.length>0&&d.append(""+k+"
"),void 0!==l&&l&&l.length>0&&d.append(""+l+"
");var n=function(a){var b=i.width(),c=i.height();return{w:b+"px",h:c+"px",cw:a*b+"px",ch:a*c+"px"}},o=function(a){"vertical"===e?i.css("clip","rect(0,"+a.w+","+a.ch+",0)"):i.css("clip","rect(0,"+a.cw+","+a.h+",0)"),d.css("height",a.h)},p=function(a){var b=n(a);m.css("vertical"===e?"top":"left","vertical"===e?b.ch:b.cw),o(b)};a(window).on("resize.twentytwenty",function(a){p(c)});var q=0,r=0;m.on("movestart",function(a){(a.distX>a.distY&&a.distX<-a.distY||a.distX-a.distY)&&"vertical"!==e?a.preventDefault():(a.distXa.distY&&a.distX>-a.distY)&&"vertical"===e&&a.preventDefault(),d.addClass("active"),d.removeClass("active-click"),q=d.offset().left,offsetY=d.offset().top,r=i.width(),imgHeight=i.height()}),m.on("moveend",function(a){d.removeClass("active")}),m.on("move",function(a){d.hasClass("active")&&(c="vertical"===e?(a.pageY-offsetY)/imgHeight:(a.pageX-q)/r,c<0&&(c=0),c>1&&(c=1),p(c))}),h||d.hasClass("active")||(d.on("mouseup",function(a){d.removeClass("active-click")}),d.on("mousedown",function(a){d.addClass("active-click"),q=d.offset().left,offsetY=d.offset().top,r=i.width(),imgHeight=i.height(),c="vertical"===e?(a.pageY-offsetY)/imgHeight:(a.pageX-q)/r,c<0&&(c=0),c>1&&(c=1),p(c)})),d.find("img").on("mousedown",function(a){a.preventDefault()}),h&&(d.on("mouseenter",function(a){d.addClass("active"),q=d.offset().left,offsetY=d.offset().top,r=i.width(),imgHeight=i.height()}),d.on("mouseleave",function(a){d.removeClass("active")}),d.on("mousemove",function(a){d.hasClass("active")&&(c="vertical"===e?(a.pageY-offsetY)/imgHeight:(a.pageX-q)/r,c<0&&(c=0),c>1&&(c=1),p(c))})),a(window).trigger("resize.twentytwenty")})})}),jQuery(document).ready(function(a){"ontouchstart"in window||!("on"==dtLocal.themeSettings.smoothScroll||"on_parallax"==dtLocal.themeSettings.smoothScroll&&a(".stripe-parallax-bg").length>0)||a("body").css({"scroll-behavior":"smooth"})}),jQuery(document).ready(function(a){var b=a(window),c=b.height();b.resize(function(){c=b.height()}),a.fn.parallax=function(d,e,f){function g(){var b=dtGlobals.winScrollTop;k.each(function(){var f=a(this),g=f.offset().top;g+h(f)b+c||k.css("backgroundPosition",d+" "+Math.round((g-b)*e)+"px")})}var h,i,j,k=a(this);k.each(function(){i=k.offset().top}),h=f?function(a){return a.outerHeight(!0)}:function(a){return a.height()},(arguments.length<1||null===d)&&(d="50%"),(arguments.length<2||null===e)&&(e=.1),(arguments.length<3||null===f)&&(f=!0),b.bind("scroll",g).resize(function(){g()}).bind("debouncedresize",function(){clearTimeout(j),j=setTimeout(function(){g()},20)}),g()}}),function(a){"undefined"!=typeof module&&module.exports?module.exports=a:a(jQuery,window,document)}(function(a){!function(b){!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),function(){var b,c="mCustomScrollbar",d={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0,autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},e=0,f={},g=window.attachEvent&&!window.addEventListener?1:0,h=!1,i=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],j={init:function(b){var b=a.extend(!0,{},d,b),c=k.call(this);if(b.live){var g=b.liveSelector||this.selector||".mCustomScrollbar",h=a(g);if("off"===b.live)return void m(g);f[g]=setTimeout(function(){h.mCustomScrollbar(b),"once"===b.live&&h.length&&m(g)},500)}else m(g);return b.setWidth=b.set_width?b.set_width:b.setWidth,b.setHeight=b.set_height?b.set_height:b.setHeight,b.axis=b.horizontalScroll?"x":n(b.axis),b.scrollInertia=b.scrollInertia>0&&b.scrollInertia<17?17:b.scrollInertia,"object"!=typeof b.mouseWheel&&1==b.mouseWheel&&(b.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),b.mouseWheel.scrollAmount=b.mouseWheelPixels?b.mouseWheelPixels:b.mouseWheel.scrollAmount,b.mouseWheel.normalizeDelta=b.advanced.normalizeMouseWheelDelta?b.advanced.normalizeMouseWheelDelta:b.mouseWheel.normalizeDelta,b.scrollButtons.scrollType=o(b.scrollButtons.scrollType),l(b),a(c).each(function(){var c=a(this);if(!c.data("mCS")){c.data("mCS",{idx:++e,opt:b,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:c.css("direction"),cbOffsets:null,trigger:null});var d=c.data("mCS"),f=d.opt,g=c.data("mcs-axis"),h=c.data("mcs-scrollbar-position"),k=c.data("mcs-theme");g&&(f.axis=g),h&&(f.scrollbarPosition=h),k&&(f.theme=k,l(f)),p.call(this),a("#mCSB_"+d.idx+"_container img:not(."+i[2]+")").addClass(i[2]),j.update.call(null,c)}})},update:function(b,c){var d=b||k.call(this);return a(d).each(function(){var b=a(this);if(b.data("mCS")){var d=b.data("mCS"),e=d.opt,f=a("#mCSB_"+d.idx+"_container"),g=[a("#mCSB_"+d.idx+"_dragger_vertical"),a("#mCSB_"+d.idx+"_dragger_horizontal")];if(!f.length)return;d.tweenRunning&&T(b),b.hasClass(i[3])&&b.removeClass(i[3]),b.hasClass(i[4])&&b.removeClass(i[4]),t.call(this),r.call(this),"y"===e.axis||e.advanced.autoExpandHorizontalScroll||f.css("width",q(f.children())),d.overflowed=x.call(this),B.call(this),e.autoDraggerLength&&u.call(this),v.call(this),z.call(this);var h=[Math.abs(f[0].offsetTop),Math.abs(f[0].offsetLeft)];"x"!==e.axis&&(d.overflowed[0]?g[0].height()>g[0].parent().height()?y.call(this):(U(b,h[0].toString(),{dir:"y",dur:0,overwrite:"none"}),d.contentReset.y=null):(y.call(this),"y"===e.axis?A.call(this):"yx"===e.axis&&d.overflowed[1]&&U(b,h[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==e.axis&&(d.overflowed[1]?g[1].width()>g[1].parent().width()?y.call(this):(U(b,h[1].toString(),{dir:"x",dur:0,overwrite:"none"}),d.contentReset.x=null):(y.call(this),"x"===e.axis?A.call(this):"yx"===e.axis&&d.overflowed[0]&&U(b,h[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),c&&d&&(2===c&&e.callbacks.onImageLoad&&"function"==typeof e.callbacks.onImageLoad?e.callbacks.onImageLoad.call(this):3===c&&e.callbacks.onSelectorChange&&"function"==typeof e.callbacks.onSelectorChange?e.callbacks.onSelectorChange.call(this):e.callbacks.onUpdate&&"function"==typeof e.callbacks.onUpdate&&e.callbacks.onUpdate.call(this)),R.call(this)}})},scrollTo:function(b,c){if(void 0!==b&&null!=b){var d=k.call(this);return a(d).each(function(){var d=a(this);if(d.data("mCS")){var e=d.data("mCS"),f=e.opt,g={trigger:"external",scrollInertia:f.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},h=a.extend(!0,{},g,c),i=P.call(this,b),j=h.scrollInertia>0&&h.scrollInertia<17?17:h.scrollInertia;i[0]=Q.call(this,i[0],"y"),i[1]=Q.call(this,i[1],"x"),h.moveDragger&&(i[0]*=e.scrollRatio.y,i[1]*=e.scrollRatio.x),h.dur=j,setTimeout(function(){null!==i[0]&&void 0!==i[0]&&"x"!==f.axis&&e.overflowed[0]&&(h.dir="y",h.overwrite="all",U(d,i[0].toString(),h)),null!==i[1]&&void 0!==i[1]&&"y"!==f.axis&&e.overflowed[1]&&(h.dir="x",h.overwrite="none",U(d,i[1].toString(),h))},h.timeout)}})}},stop:function(){var b=k.call(this);return a(b).each(function(){var b=a(this);b.data("mCS")&&T(b)})},disable:function(b){var c=k.call(this);return a(c).each(function(){var c=a(this);if(c.data("mCS")){c.data("mCS");R.call(this,"remove"),A.call(this),b&&y.call(this),B.call(this,!0),c.addClass(i[3])}})},destroy:function(){var b=k.call(this);return a(b).each(function(){var d=a(this);if(d.data("mCS")){var e=d.data("mCS"),f=e.opt,g=a("#mCSB_"+e.idx),h=a("#mCSB_"+e.idx+"_container"),j=a(".mCSB_"+e.idx+"_scrollbar");f.live&&m(f.liveSelector||a(b).selector),R.call(this,"remove"),A.call(this),y.call(this),d.removeData("mCS"),Y(this,"mcs"),j.remove(),h.find("img."+i[2]).removeClass(i[2]),g.replaceWith(h.contents()),d.removeClass(c+" _mCS_"+e.idx+" "+i[6]+" "+i[7]+" "+i[5]+" "+i[3]).addClass(i[4])}})}},k=function(){return"object"!=typeof a(this)||a(this).length<1?".mCustomScrollbar":this},l=function(b){var c=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],d=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],e=["minimal","minimal-dark"],f=["minimal","minimal-dark"],g=["minimal","minimal-dark"];b.autoDraggerLength=!(a.inArray(b.theme,c)>-1)&&b.autoDraggerLength,b.autoExpandScrollbar=!(a.inArray(b.theme,d)>-1)&&b.autoExpandScrollbar,b.scrollButtons.enable=!(a.inArray(b.theme,e)>-1)&&b.scrollButtons.enable,b.autoHideScrollbar=a.inArray(b.theme,f)>-1||b.autoHideScrollbar,b.scrollbarPosition=a.inArray(b.theme,g)>-1?"outside":b.scrollbarPosition},m=function(a){f[a]&&(clearTimeout(f[a]),Y(f,a))},n=function(a){return"yx"===a||"xy"===a||"auto"===a?"yx":"x"===a||"horizontal"===a?"x":"y"},o=function(a){return"stepped"===a||"pixels"===a||"step"===a||"click"===a?"stepped":"stepless"},p=function(){var b=a(this),d=b.data("mCS"),e=d.opt,f=e.autoExpandScrollbar?" "+i[1]+"_expand":"",g=["",""],h="yx"===e.axis?"mCSB_vertical_horizontal":"x"===e.axis?"mCSB_horizontal":"mCSB_vertical",j="yx"===e.axis?g[0]+g[1]:"x"===e.axis?g[1]:g[0],k="yx"===e.axis?"":"",l=e.autoHideScrollbar?" "+i[6]:"",m="x"!==e.axis&&"rtl"===d.langDir?" "+i[7]:"";e.setWidth&&b.css("width",e.setWidth),e.setHeight&&b.css("height",e.setHeight),e.setLeft="y"!==e.axis&&"rtl"===d.langDir?"989999px":e.setLeft,b.addClass(c+" _mCS_"+d.idx+l+m).wrapInner("")
;var n=a("#mCSB_"+d.idx),o=a("#mCSB_"+d.idx+"_container");"y"===e.axis||e.advanced.autoExpandHorizontalScroll||o.css("width",q(o.children())),"outside"===e.scrollbarPosition?("static"===b.css("position")&&b.css("position","relative"),b.css("overflow","visible"),n.addClass("mCSB_outside").after(j)):(n.addClass("mCSB_inside").append(j),o.wrap(k)),s.call(this);var p=[a("#mCSB_"+d.idx+"_dragger_vertical"),a("#mCSB_"+d.idx+"_dragger_horizontal")];p[0].css("min-height",p[0].height()),p[1].css("min-width",p[1].width())},q=function(b){return Math.max.apply(Math,b.map(function(){return a(this).outerWidth(!0)}).get())},r=function(){var b=a(this),c=b.data("mCS"),d=c.opt,e=a("#mCSB_"+c.idx+"_container");d.advanced.autoExpandHorizontalScroll&&"y"!==d.axis&&e.css({position:"absolute",width:"auto"}).wrap("").css({width:Math.ceil(e[0].getBoundingClientRect().right+.4)-Math.floor(e[0].getBoundingClientRect().left),position:"relative"}).unwrap()},s=function(){var b=a(this),c=b.data("mCS"),d=c.opt,e=a(".mCSB_"+c.idx+"_scrollbar:first"),f=_(d.scrollButtons.tabindex)?"tabindex='"+d.scrollButtons.tabindex+"'":"",g=["","","",""],h=["x"===d.axis?g[2]:g[0],"x"===d.axis?g[3]:g[1],g[2],g[3]];d.scrollButtons.enable&&e.prepend(h[0]).append(h[1]).next(".mCSB_scrollTools").prepend(h[2]).append(h[3])},t=function(){var b=a(this),c=b.data("mCS"),d=a("#mCSB_"+c.idx),e=b.css("max-height")||"none",f=-1!==e.indexOf("%"),g=b.css("box-sizing");if("none"!==e){var h=f?b.parent().height()*parseInt(e)/100:parseInt(e);"border-box"===g&&(h-=b.innerHeight()-b.height()+(b.outerHeight()-b.innerHeight())),d.css("max-height",Math.round(h))}},u=function(){var b=a(this),c=b.data("mCS"),d=a("#mCSB_"+c.idx),e=a("#mCSB_"+c.idx+"_container"),f=[a("#mCSB_"+c.idx+"_dragger_vertical"),a("#mCSB_"+c.idx+"_dragger_horizontal")],h=[d.height()/e.outerHeight(!1),d.width()/e.outerWidth(!1)],i=[parseInt(f[0].css("min-height")),Math.round(h[0]*f[0].parent().height()),parseInt(f[1].css("min-width")),Math.round(h[1]*f[1].parent().width())],j=g&&i[1]d.height(),g>d.width()]},y=function(){var b=a(this),c=b.data("mCS"),d=c.opt,e=a("#mCSB_"+c.idx),f=a("#mCSB_"+c.idx+"_container"),g=[a("#mCSB_"+c.idx+"_dragger_vertical"),a("#mCSB_"+c.idx+"_dragger_horizontal")];if(T(b),("x"!==d.axis&&!c.overflowed[0]||"y"===d.axis&&c.overflowed[0])&&(g[0].add(f).css("top",0),U(b,"_resetY")),"y"!==d.axis&&!c.overflowed[1]||"x"===d.axis&&c.overflowed[1]){var h=dx=0;"rtl"===c.langDir&&(h=e.width()-f.outerWidth(!1),dx=Math.abs(h/c.scrollRatio.x)),f.css("left",h),g[1].css("left",dx),U(b,"_resetX")}},z=function(){function b(){f=setTimeout(function(){a.event.special.mousewheel?(clearTimeout(f),G.call(c[0])):b()},100)}var c=a(this),d=c.data("mCS"),e=d.opt;if(!d.bindEvents){if(D.call(this),e.contentTouchScroll&&E.call(this),F.call(this),e.mouseWheel.enable){var f;b()}J.call(this),L.call(this),e.advanced.autoScrollOnFocus&&K.call(this),e.scrollButtons.enable&&M.call(this),e.keyboard.enable&&N.call(this),d.bindEvents=!0}},A=function(){var b=a(this),c=b.data("mCS"),d=c.opt,e="mCS_"+c.idx,f=".mCSB_"+c.idx+"_scrollbar",g=a("#mCSB_"+c.idx+",#mCSB_"+c.idx+"_container,#mCSB_"+c.idx+"_container_wrapper,"+f+" ."+i[12]+",#mCSB_"+c.idx+"_dragger_vertical,#mCSB_"+c.idx+"_dragger_horizontal,"+f+">a"),h=a("#mCSB_"+c.idx+"_container");d.advanced.releaseDraggableSelectors&&g.add(a(d.advanced.releaseDraggableSelectors)),c.bindEvents&&(a(document).unbind("."+e),g.each(function(){a(this).unbind("."+e)}),clearTimeout(b[0]._focusTimeout),Y(b[0],"_focusTimeout"),clearTimeout(c.sequential.step),Y(c.sequential,"step"),clearTimeout(h[0].onCompleteTimeout),Y(h[0],"onCompleteTimeout"),c.bindEvents=!1)},B=function(b){var c=a(this),d=c.data("mCS"),e=d.opt,f=a("#mCSB_"+d.idx+"_container_wrapper"),g=f.length?f:a("#mCSB_"+d.idx+"_container"),h=[a("#mCSB_"+d.idx+"_scrollbar_vertical"),a("#mCSB_"+d.idx+"_scrollbar_horizontal")],j=[h[0].find(".mCSB_dragger"),h[1].find(".mCSB_dragger")];"x"!==e.axis&&(d.overflowed[0]&&!b?(h[0].add(j[0]).add(h[0].children("a")).css("display","block"),g.removeClass(i[8]+" "+i[10])):(e.alwaysShowScrollbar?(2!==e.alwaysShowScrollbar&&j[0].css("display","none"),g.removeClass(i[10])):(h[0].css("display","none"),g.addClass(i[10])),g.addClass(i[8]))),"y"!==e.axis&&(d.overflowed[1]&&!b?(h[1].add(j[1]).add(h[1].children("a")).css("display","block"),g.removeClass(i[9]+" "+i[11])):(e.alwaysShowScrollbar?(2!==e.alwaysShowScrollbar&&j[1].css("display","none"),g.removeClass(i[11])):(h[1].css("display","none"),g.addClass(i[11])),g.addClass(i[9]))),d.overflowed[0]||d.overflowed[1]?c.removeClass(i[5]):c.addClass(i[5])},C=function(a){switch(a.type){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a.target.ownerDocument!==document?[a.originalEvent.screenY,a.originalEvent.screenX,!1]:[a.originalEvent.pageY,a.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var b=a.originalEvent.touches[0]||a.originalEvent.changedTouches[0],c=a.originalEvent.touches.length||a.originalEvent.changedTouches.length;return a.target.ownerDocument!==document?[b.screenY,b.screenX,c>1]:[b.pageY,b.pageX,c>1];default:return[a.pageY,a.pageX,!1]}},D=function(){function b(a){var b=n.find("iframe");if(b.length){var c=a?"auto":"none";b.css("pointer-events",c)}}function c(a,b,c,e){if(n[0].idleTimer=k.scrollInertia<233?250:0,d.attr("id")===m[1])var f="x",g=(d[0].offsetLeft-b+e)*j.scrollRatio.x;else var f="y",g=(d[0].offsetTop-a+c)*j.scrollRatio.y;U(i,g.toString(),{dir:f,drag:!0})}var d,e,f,i=a(this),j=i.data("mCS"),k=j.opt,l="mCS_"+j.idx,m=["mCSB_"+j.idx+"_dragger_vertical","mCSB_"+j.idx+"_dragger_horizontal"],n=a("#mCSB_"+j.idx+"_container"),o=a("#"+m[0]+",#"+m[1]),p=k.advanced.releaseDraggableSelectors?o.add(a(k.advanced.releaseDraggableSelectors)):o;o.bind("mousedown."+l+" touchstart."+l+" pointerdown."+l+" MSPointerDown."+l,function(c){if(c.stopImmediatePropagation(),c.preventDefault(),Z(c)){h=!0,g&&(document.onselectstart=function(){return!1}),b(!1),T(i),d=a(this);var j=d.offset(),l=C(c)[0]-j.top,m=C(c)[1]-j.left,n=d.height()+j.top,o=d.width()+j.left;l0&&m0&&(e=l,f=m),w(d,"active",k.autoExpandScrollbar)}}).bind("touchmove."+l,function(a){a.stopImmediatePropagation(),a.preventDefault();var b=d.offset(),g=C(a)[0]-b.top,h=C(a)[1]-b.left;c(e,f,g,h)}),a(document).bind("mousemove."+l+" pointermove."+l+" MSPointerMove."+l,function(a){if(d){var b=d.offset(),g=C(a)[0]-b.top,h=C(a)[1]-b.left;if(e===g)return;c(e,f,g,h)}}).add(p).bind("mouseup."+l+" touchend."+l+" pointerup."+l+" MSPointerUp."+l,function(a){d&&(w(d,"active",k.autoExpandScrollbar),d=null),h=!1,g&&(document.onselectstart=null),b(!0)})},E=function(){function c(a){if(!$(a)||h||C(a)[2])return void(b=0);b=1,u=0,v=0,w.removeClass("mCS_touch_action");var c=B.offset();j=C(a)[0]-c.top,k=C(a)[1]-c.left,J=[C(a)[0],C(a)[1]]}function d(a){if($(a)&&!h&&!C(a)[2]&&(a.stopImmediatePropagation(),!v||u)){o=W();var b=A.offset(),c=C(a)[0]-b.top,d=C(a)[1]-b.left;if(E.push(c),F.push(d),J[2]=Math.abs(C(a)[0]-J[0]),J[3]=Math.abs(C(a)[1]-J[1]),x.overflowed[0])var e=D[0].parent().height()-D[0].height(),f=j-c>0&&c-j>-e*x.scrollRatio.y&&(2*J[3]0&&d-k>-g*x.scrollRatio.x&&(2*J[2]30)){r=1e3/(p-n);var e=r<2.5,f=e?[E[E.length-2],F[F.length-2]]:[0,0];q=e?[c-f[0],d-f[1]]:[c-l,d-m];var j=[Math.abs(q[0]),Math.abs(q[1])];r=e?[Math.abs(q[0]/4),Math.abs(q[1]/4)]:[r,r];var k=[Math.abs(B[0].offsetTop)-q[0]*g(j[0]/r[0],r[0]),Math.abs(B[0].offsetLeft)-q[1]*g(j[1]/r[1],r[1])];s="yx"===y.axis?[k[0],k[1]]:"x"===y.axis?[null,k[1]]:[k[0],null],t=[4*j[0]+y.scrollInertia,4*j[1]+y.scrollInertia];var w=parseInt(y.contentTouchScroll)||0;s[0]=j[0]>w?s[0]:0,s[1]=j[1]>w?s[1]:0,x.overflowed[0]&&i(s[0],t[0],"mcsEaseOut","y",I,!1),x.overflowed[1]&&i(s[1],t[1],"mcsEaseOut","x",I,!1)}}}function g(a,b){var c=[1.5*b,2*b,b/1.5,b/2];return a>90?b>4?c[0]:c[3]:a>60?b>3?c[3]:c[2]:a>30?b>8?c[1]:b>6?c[0]:b>4?b:c[2]:b>8?b:c[3]}function i(a,b,c,d,e,f){a&&U(w,a.toString(),{dur:b,scrollEasing:c,dir:d,overwrite:e,drag:f})}var j,k,l,m,n,o,p,q,r,s,t,u,v,w=a(this),x=w.data("mCS"),y=x.opt,z="mCS_"+x.idx,A=a("#mCSB_"+x.idx),B=a("#mCSB_"+x.idx+"_container"),D=[a("#mCSB_"+x.idx+"_dragger_vertical"),a("#mCSB_"+x.idx+"_dragger_horizontal")],E=[],F=[],G=0,I="yx"===y.axis?"none":"all",J=[],K=B.find("iframe"),L=["touchstart."+z+" pointerdown."+z+" MSPointerDown."+z,"touchmove."+z+" pointermove."+z+" MSPointerMove."+z,"touchend."+z+" pointerup."+z+" MSPointerUp."+z];B.bind(L[0],function(a){c(a)}).bind(L[1],function(a){d(a)}),A.bind(L[0],function(a){e(a)}).bind(L[2],function(a){f(a)}),K.length&&K.each(function(){a(this).load(function(){H(this)&&a(this.contentDocument||this.contentWindow.document).bind(L[0],function(a){c(a),e(a)}).bind(L[1],function(a){d(a)}).bind(L[2],function(a){f(a)})})})},F=function(){function c(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function d(a,b,c){j.type=c&&e?"stepped":"stepless",j.scrollAmount=10,O(f,a,b,"mcsLinearOut",c?60:null)}var e,f=a(this),g=f.data("mCS"),i=g.opt,j=g.sequential,k="mCS_"+g.idx,l=a("#mCSB_"+g.idx+"_container"),m=l.parent();l.bind("mousedown."+k,function(a){b||e||(e=1,h=!0)}).add(document).bind("mousemove."+k,function(a){if(!b&&e&&c()){var f=l.offset(),h=C(a)[0]-f.top+l[0].offsetTop,k=C(a)[1]-f.left+l[0].offsetLeft;h>0&&h0&&km.height()&&d("on",40)),"y"!==i.axis&&g.overflowed[1]&&(k<0?d("on",37):k>m.width()&&d("on",39)))}}).bind("mouseup."+k,function(a){b||(e&&(e=0,d("off",null)),h=!1)})},G=function(){function b(b,f){if(T(c),!I(c,b.target)){var j="auto"!==e.mouseWheel.deltaFactor?parseInt(e.mouseWheel.deltaFactor):g&&b.deltaFactor<100?100:b.deltaFactor||100;if("x"===e.axis||"x"===e.mouseWheel.axis)var k="x",l=[Math.round(j*d.scrollRatio.x),parseInt(e.mouseWheel.scrollAmount)],m="auto"!==e.mouseWheel.scrollAmount?l[1]:l[0]>=h.width()?.9*h.width():l[0],n=Math.abs(a("#mCSB_"+d.idx+"_container")[0].offsetLeft),o=i[1][0].offsetLeft,p=i[1].parent().width()-i[1].width(),q=b.deltaX||b.deltaY||f;else var k="y",l=[Math.round(j*d.scrollRatio.y),parseInt(e.mouseWheel.scrollAmount)],m="auto"!==e.mouseWheel.scrollAmount?l[1]:l[0]>=h.height()?.9*h.height():l[0],n=Math.abs(a("#mCSB_"+d.idx+"_container")[0].offsetTop),o=i[0][0].offsetTop,p=i[0].parent().height()-i[0].height(),q=b.deltaY||f;"y"===k&&!d.overflowed[0]||"x"===k&&!d.overflowed[1]||((e.mouseWheel.invert||b.webkitDirectionInvertedFromDevice)&&(q=-q),e.mouseWheel.normalizeDelta&&(q=q<0?-1:1),(q>0&&0!==o||q<0&&o!==p||e.mouseWheel.preventDefault)&&(b.stopImmediatePropagation(),b.preventDefault()),U(c,(n-q*m).toString(),{dir:k}))}}if(a(this).data("mCS")){var c=a(this),d=c.data("mCS"),e=d.opt,f="mCS_"+d.idx,h=a("#mCSB_"+d.idx),i=[a("#mCSB_"+d.idx+"_dragger_vertical"),a("#mCSB_"+d.idx+"_dragger_horizontal")],j=a("#mCSB_"+d.idx+"_container").find("iframe");j.length&&j.each(function(){a(this).load(function(){H(this)&&a(this.contentDocument||this.contentWindow.document).bind("mousewheel."+f,function(a,c){b(a,c)})})}),h.bind("mousewheel."+f,function(a,c){b(a,c)})}},H=function(a){var b=null;try{b=(a.contentDocument||a.contentWindow.document).body.innerHTML}catch(a){}return null!==b},I=function(b,c){var d=c.nodeName.toLowerCase(),e=b.data("mCS").opt.mouseWheel.disableOver,f=["select","textarea"];return a.inArray(d,e)>-1&&!(a.inArray(d,f)>-1&&!a(c).is(":focus"))},J=function(){var b=a(this),c=b.data("mCS"),d="mCS_"+c.idx,e=a("#mCSB_"+c.idx+"_container"),f=e.parent();a(".mCSB_"+c.idx+"_scrollbar ."+i[12]).bind("touchstart."+d+" pointerdown."+d+" MSPointerDown."+d,function(a){h=!0}).bind("touchend."+d+" pointerup."+d+" MSPointerUp."+d,function(a){h=!1}).bind("click."+d,function(d){if(a(d.target).hasClass(i[12])||a(d.target).hasClass("mCSB_draggerRail")){T(b);var g=a(this),h=g.find(".mCSB_dragger");if(g.parent(".mCSB_scrollTools_horizontal").length>0){if(!c.overflowed[1])return;var j="x",k=d.pageX>h.offset().left?-1:1,l=Math.abs(e[0].offsetLeft)-k*(.9*f.width())}else{if(!c.overflowed[0])return;var j="y",k=d.pageY>h.offset().top?-1:1,l=Math.abs(e[0].offsetTop)-k*(.9*f.height())}U(b,l.toString(),{dir:j,scrollEasing:"mcsEaseInOut"})}})},K=function(){var b=a(this),c=b.data("mCS"),d=c.opt,e="mCS_"+c.idx,f=a("#mCSB_"+c.idx+"_container"),g=f.parent();f.bind("focusin."+e,function(c){var e=a(document.activeElement),h=f.find(".mCustomScrollBox").length;e.is(d.advanced.autoScrollOnFocus)&&(T(b),clearTimeout(b[0]._focusTimeout),b[0]._focusTimer=h?17*h:0,b[0]._focusTimeout=setTimeout(function(){var a=[aa(e)[0],aa(e)[1]],c=[f[0].offsetTop,f[0].offsetLeft],h=[c[0]+a[0]>=0&&c[0]+a[0]=0&&c[0]+a[1]a").bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f+" mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f+" mouseout."+f+" pointerout."+f+" MSPointerOut."+f+" click."+f,function(f){function g(a,c){e.scrollAmount=d.snapAmount||d.scrollButtons.scrollAmount,O(b,a,c)}if(f.preventDefault(),Z(f)){var i=a(this).attr("class");switch(e.type=d.scrollButtons.scrollType,f.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===e.type)return;h=!0,c.tweenRunning=!1,g("on",i);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===e.type)return;h=!1,e.dir&&g("off",i);break;case"click":if("stepped"!==e.type||c.tweenRunning)return;g("on",i)}}})},N=function(){function b(b){function g(a,b){f.type=e.keyboard.scrollType,f.scrollAmount=e.snapAmount||e.keyboard.scrollAmount,"stepped"===f.type&&d.tweenRunning||O(c,a,b)}switch(b.type){case"blur":d.tweenRunning&&f.dir&&g("off",null);break;case"keydown":case"keyup":var h=b.keyCode?b.keyCode:b.which,l="on";if("x"!==e.axis&&(38===h||40===h)||"y"!==e.axis&&(37===h||39===h)){if((38===h||40===h)&&!d.overflowed[0]||(37===h||39===h)&&!d.overflowed[1])return;"keyup"===b.type&&(l="off"),a(document.activeElement).is(k)||(b.preventDefault(),b.stopImmediatePropagation(),g(l,h))}else if(33===h||34===h){if((d.overflowed[0]||d.overflowed[1])&&(b.preventDefault(),b.stopImmediatePropagation()),"keyup"===b.type){T(c);var m=34===h?-1:1;if("x"===e.axis||"yx"===e.axis&&d.overflowed[1]&&!d.overflowed[0])var n="x",o=Math.abs(i[0].offsetLeft)-m*(.9*j.width());else var n="y",o=Math.abs(i[0].offsetTop)-m*(.9*j.height());U(c,o.toString(),{dir:n,scrollEasing:"mcsEaseInOut"})}}else if((35===h||36===h)&&!a(document.activeElement).is(k)&&((d.overflowed[0]||d.overflowed[1])&&(b.preventDefault(),b.stopImmediatePropagation()),"keyup"===b.type)){if("x"===e.axis||"yx"===e.axis&&d.overflowed[1]&&!d.overflowed[0])var n="x",o=35===h?Math.abs(j.width()-i.outerWidth(!1)):0;else var n="y",o=35===h?Math.abs(j.height()-i.outerHeight(!1)):0;U(c,o.toString(),{dir:n,scrollEasing:"mcsEaseInOut"})}}}var c=a(this),d=c.data("mCS"),e=d.opt,f=d.sequential,g="mCS_"+d.idx,h=a("#mCSB_"+d.idx),i=a("#mCSB_"+d.idx+"_container"),j=i.parent(),k="input,textarea,select,datalist,keygen,[contenteditable='true']",l=i.find("iframe"),m=["blur."+g+" keydown."+g+" keyup."+g];l.length&&l.each(function(){a(this).load(function(){H(this)&&a(this.contentDocument||this.contentWindow.document).bind(m[0],function(a){b(a)})})}),h.attr("tabindex","0").bind(m[0],function(a){b(a)})},O=function(b,c,d,e,f){function g(a){var c="stepped"!==k.type,d=f||(a?c?n/1.5:o:1e3/60),i=a?c?7.5:40:2.5,j=[Math.abs(l[0].offsetTop),Math.abs(l[0].offsetLeft)],m=[h.scrollRatio.y>10?10:h.scrollRatio.y,h.scrollRatio.x>10?10:h.scrollRatio.x],p="x"===k.dir[0]?j[1]+k.dir[1]*(m[1]*i):j[0]+k.dir[1]*(m[0]*i),q="x"===k.dir[0]?j[1]+k.dir[1]*parseInt(k.scrollAmount):j[0]+k.dir[1]*parseInt(k.scrollAmount),r="auto"!==k.scrollAmount?q:p,s=e||(a?c?"mcsLinearOut":"mcsEaseInOut":"mcsLinear"),t=!!a;if(a&&d<17&&(r="x"===k.dir[0]?j[1]:j[0]),U(b,r.toString(),{dir:k.dir[0],scrollEasing:s,dur:d,onComplete:t}),a)return void(k.dir=!1);clearTimeout(k.step),k.step=setTimeout(function(){g()},d)}var h=b.data("mCS"),j=h.opt,k=h.sequential,l=a("#mCSB_"+h.idx+"_container"),m="stepped"===k.type,n=j.scrollInertia<26?26:j.scrollInertia,o=j.scrollInertia<1?17:j.scrollInertia;switch(c){case"on":if(k.dir=[d===i[16]||d===i[15]||39===d||37===d?"x":"y",d===i[13]||d===i[15]||38===d||37===d?-1:1],T(b),_(d)&&"stepped"===k.type)return;g(m);break;case"off":!function(){clearTimeout(k.step),Y(k,"step"),T(b)}(),(m||h.tweenRunning&&k.dir)&&g(!0)}},P=function(b){var c=a(this).data("mCS").opt,d=[];return"function"==typeof b&&(b=b()),b instanceof Array?d=b.length>1?[b[0],b[1]]:"x"===c.axis?[null,b[0]]:[b[0],null]:(d[0]=b.y?b.y:b.x||"x"===c.axis?null:b,d[1]=b.x?b.x:b.y||"y"===c.axis?null:b),"function"==typeof d[0]&&(d[0]=d[0]()),"function"==typeof d[1]&&(d[1]=d[1]()),d},Q=function(b,c){if(null!=b&&void 0!==b){var d=a(this),e=d.data("mCS"),f=e.opt,g=a("#mCSB_"+e.idx+"_container"),h=g.parent(),i=typeof b;c||(c="x"===f.axis?"x":"y");var k="x"===c?g.outerWidth(!1):g.outerHeight(!1),l="x"===c?g[0].offsetLeft:g[0].offsetTop,m="x"===c?"left":"top";switch(i){case"function":return b();case"object":var n=b.jquery?b:a(b);if(!n.length)return;return"x"===c?aa(n)[1]:aa(n)[0];case"string":case"number":if(_(b))return Math.abs(b);if(-1!==b.indexOf("%"))return Math.abs(k*parseInt(b)/100);if(-1!==b.indexOf("-="))return Math.abs(l-parseInt(b.split("-=")[1]));if(-1!==b.indexOf("+=")){var o=l+parseInt(b.split("+=")[1]);return o>=0?0:Math.abs(o)}if(-1!==b.indexOf("px")&&_(b.split("px")[0]))return Math.abs(b.split("px")[0]);if("top"===b||"left"===b)return 0;if("bottom"===b)return Math.abs(h.height()-g.outerHeight(!1));if("right"===b)return Math.abs(h.width()-g.outerWidth(!1));if("first"===b||"last"===b){var n=g.find(":"+b);return"x"===c?aa(n)[1]:aa(n)[0]}return a(b).length?"x"===c?aa(a(b))[1]:aa(a(b))[0]:(g.css(m,b),void j.update.call(null,d[0]))}}},R=function(b){function c(){if(clearTimeout(m[0].autoUpdate),0===h.parents("html").length)return void(h=null);m[0].autoUpdate=setTimeout(function(){if(l.advanced.updateOnSelectorChange&&(n=f())!==t)return g(3),void(t=n);l.advanced.updateOnContentResize&&(o=[m.outerHeight(!1),m.outerWidth(!1),q.height(),q.width(),s()[0],s()[1]],o[0]===u[0]&&o[1]===u[1]&&o[2]===u[2]&&o[3]===u[3]&&o[4]===u[4]&&o[5]===u[5]||(g(o[0]!==u[0]||o[1]!==u[1]),u=o)),l.advanced.updateOnImageLoad&&(p=d())!==v&&(m.find("img").each(function(){e(this)}),v=p),(l.advanced.updateOnSelectorChange||l.advanced.updateOnContentResize||l.advanced.updateOnImageLoad)&&c()},l.advanced.autoUpdateTimeout)}function d(){var a=0;return l.advanced.updateOnImageLoad&&(a=m.find("img").length),a}function e(b){function c(){this.onload=null,a(b).addClass(i[2]),g(2)}if(a(b).hasClass(i[2]))return void g();var d=new Image;d.onload=function(a,b){return function(){return b.apply(a,arguments)}}(d,c),d.src=b.src}function f(){!0===l.advanced.updateOnSelectorChange&&(l.advanced.updateOnSelectorChange="*");var b=0,c=m.find(l.advanced.updateOnSelectorChange);return l.advanced.updateOnSelectorChange&&c.length>0&&c.each(function(){b+=a(this).height()+a(this).width()}),b}function g(a){clearTimeout(m[0].autoUpdate),j.update.call(null,h[0],a)}var h=a(this),k=h.data("mCS"),l=k.opt,m=a("#mCSB_"+k.idx+"_container");if(b)return clearTimeout(m[0].autoUpdate),void Y(m[0],"autoUpdate");var n,o,p,q=m.parent(),r=[a("#mCSB_"+k.idx+"_scrollbar_vertical"),a("#mCSB_"+k.idx+"_scrollbar_horizontal")],s=function(){return[r[0].is(":visible")?r[0].outerHeight(!0):0,r[1].is(":visible")?r[1].outerWidth(!0):0]},t=f(),u=[m.outerHeight(!1),m.outerWidth(!1),q.height(),q.width(),s()[0],s()[1]],v=d();c()},S=function(a,b,c){return Math.round(a/b)*b-c},T=function(b){var c=b.data("mCS");a("#mCSB_"+c.idx+"_container,#mCSB_"+c.idx+"_container_wrapper,#mCSB_"+c.idx+"_dragger_vertical,#mCSB_"+c.idx+"_dragger_horizontal").each(function(){X.call(this)})},U=function(b,c,d){function e(a){return h&&i.callbacks[a]&&"function"==typeof i.callbacks[a]}function f(){return[i.callbacks.alwaysTriggerOffsets||s>=t[0]+v,i.callbacks.alwaysTriggerOffsets||s<=-x]}function g(){var a=[m[0].offsetTop,m[0].offsetLeft],c=[q[0].offsetTop,q[0].offsetLeft],e=[m.outerHeight(!1),m.outerWidth(!1)],f=[l.height(),l.width()];b[0].mcs={content:m,top:a[0],left:a[1],draggerTop:c[0],draggerLeft:c[1],topPct:Math.round(100*Math.abs(a[0])/(Math.abs(e[0])-f[0])),leftPct:Math.round(100*Math.abs(a[1])/(Math.abs(e[1])-f[1])),direction:d.dir}}var h=b.data("mCS"),i=h.opt,j={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:i.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},d=a.extend(j,d),k=[d.dur,d.drag?0:d.dur],l=a("#mCSB_"+h.idx),m=a("#mCSB_"+h.idx+"_container"),n=m.parent(),o=i.callbacks.onTotalScrollOffset?P.call(b,i.callbacks.onTotalScrollOffset):[0,0],p=i.callbacks.onTotalScrollBackOffset?P.call(b,i.callbacks.onTotalScrollBackOffset):[0,0];if(h.trigger=d.trigger,0===n.scrollTop()&&0===n.scrollLeft()||(a(".mCSB_"+h.idx+"_scrollbar").css("visibility","visible"),n.scrollTop(0).scrollLeft(0)),"_resetY"!==c||h.contentReset.y||(e("onOverflowYNone")&&i.callbacks.onOverflowYNone.call(b[0]),h.contentReset.y=1),"_resetX"!==c||h.contentReset.x||(e("onOverflowXNone")&&i.callbacks.onOverflowXNone.call(b[0]),h.contentReset.x=1),"_resetY"!==c&&"_resetX"!==c){switch(!h.contentReset.y&&b[0].mcs||!h.overflowed[0]||(e("onOverflowY")&&i.callbacks.onOverflowY.call(b[0]),h.contentReset.x=null),!h.contentReset.x&&b[0].mcs||!h.overflowed[1]||(e("onOverflowX")&&i.callbacks.onOverflowX.call(b[0]),h.contentReset.x=null),i.snapAmount&&(c=S(c,i.snapAmount,i.snapOffset)),d.dir){case"x":var q=a("#mCSB_"+h.idx+"_dragger_horizontal"),r="left",s=m[0].offsetLeft,t=[l.width()-m.outerWidth(!1),q.parent().width()-q.width()],u=[c,0===c?0:c/h.scrollRatio.x],v=o[1],x=p[1],y=v>0?v/h.scrollRatio.x:0,z=x>0?x/h.scrollRatio.x:0;break;case"y":var q=a("#mCSB_"+h.idx+"_dragger_vertical"),r="top",s=m[0].offsetTop,t=[l.height()-m.outerHeight(!1),q.parent().height()-q.height()],u=[c,0===c?0:c/h.scrollRatio.y],v=o[0],x=p[0],y=v>0?v/h.scrollRatio.y:0,z=x>0?x/h.scrollRatio.y:0}u[1]<0||0===u[0]&&0===u[1]?u=[0,0]:u[1]>=t[1]?u=[t[0],t[1]]:u[0]=-u[0],b[0].mcs||(g(),e("onInit")&&i.callbacks.onInit.call(b[0])),clearTimeout(m[0].onCompleteTimeout),!h.tweenRunning&&(0===s&&u[0]>=0||s===t[0]&&u[0]<=t[0])||(V(q[0],r,Math.round(u[1]),k[1],d.scrollEasing),V(m[0],r,Math.round(u[0]),k[0],d.scrollEasing,d.overwrite,{onStart:function(){d.callbacks&&d.onStart&&!h.tweenRunning&&(e("onScrollStart")&&(g(),i.callbacks.onScrollStart.call(b[0])),h.tweenRunning=!0,w(q),h.cbOffsets=f())},onUpdate:function(){d.callbacks&&d.onUpdate&&e("whileScrolling")&&(g(),i.callbacks.whileScrolling.call(b[0]))},onComplete:function(){if(d.callbacks&&d.onComplete){"yx"===i.axis&&clearTimeout(m[0].onCompleteTimeout);var a=m[0].idleTimer||0;m[0].onCompleteTimeout=setTimeout(function(){e("onScroll")&&(g(),i.callbacks.onScroll.call(b[0])),e("onTotalScroll")&&u[1]>=t[1]-y&&h.cbOffsets[0]&&(g(),i.callbacks.onTotalScroll.call(b[0])),e("onTotalScrollBack")&&u[1]<=z&&h.cbOffsets[1]&&(g(),i.callbacks.onTotalScrollBack.call(b[0])),h.tweenRunning=!1,m[0].idleTimer=0,w(q,"hide")},a)}}}))}},V=function(a,b,c,d,e,f,g){function h(){t.stop||(q||m.call(),q=W()-p,i(),q>=t.time&&(t.time=q>t.time?q+k-(q-t.time):q+k-1,t.time0?(t.currVal=j(t.time,r,u,d,e),s[b]=Math.round(t.currVal)+"px"):s[b]=c+"px",n.call()}function j(a,b,c,d,e){switch(e){case"linear":case"mcsLinear":return c*a/d+b;case"mcsLinearOut":return a/=d,a--,c*Math.sqrt(1-a*a)+b;case"easeInOutSmooth":return(a/=d/2)<1?c/2*a*a+b:(a--,-c/2*(a*(a-2)-1)+b);case"easeInOutStrong":return(a/=d/2)<1?c/2*Math.pow(2,10*(a-1))+b:(a--,c/2*(2-Math.pow(2,-10*a))+b);case"easeInOut":case"mcsEaseInOut":return(a/=d/2)<1?c/2*a*a*a+b:(a-=2,c/2*(a*a*a+2)+b);case"easeOutSmooth":return a/=d,a--,-c*(a*a*a*a-1)+b;case"easeOutStrong":return c*(1-Math.pow(2,-10*a/d))+b;case"easeOut":case"mcsEaseOut":default:var f=(a/=d)*a,g=f*a;return b+c*(.499999999999997*g*f+-2.5*f*f+5.5*g+-6.5*f+4*a)}}a._mTween||(a._mTween={top:{},left:{}});var k,l,g=g||{},m=g.onStart||function(){},n=g.onUpdate||function(){},o=g.onComplete||function(){},p=W(),q=0,r=a.offsetTop,s=a.style,t=a._mTween[b];"left"===b&&(r=a.offsetLeft);var u=c-r;t.stop=0,"none"!==f&&function(){null!=t.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(t.id):clearTimeout(t.id),t.id=null)}(),function(){k=1e3/60,t.time=q+k,l=window.requestAnimationFrame?window.requestAnimationFrame:function(a){return i(),setTimeout(a,.01)},t.id=l(h)}()},W=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},X=function(){var a=this;a._mTween||(a._mTween={top:{},left:{}});for(var b=["top","left"],c=0;c=0&&d[0]+aa(e)[0]=0&&d[1]+aa(e)[1]").addClass(f("Inner")),h=a("");c.after(h.append(g)),h.addClass(d),b.mapClass&&h.addClass(c.attr("class")),b.mapStyle&&h.attr("style",c.attr("style")),c.addClass("hasCustomSelect").on("update",function(){e(c,h);var a=parseInt(c.outerWidth(),10)-(parseInt(h.outerWidth(),10)-parseInt(h.width(),10));h.css({display:"inline-block"});var b=h.outerHeight();c.attr("disabled")?h.addClass(f("Disabled")):h.removeClass(f("Disabled")),g.css({width:a,display:"inline-block"}),c.css({"-webkit-appearance":"menulist-button",width:h.outerWidth(),position:"absolute",opacity:0,height:b,fontSize:h.css("font-size")})}).on("change",function(){h.addClass(f("Changed")),e(c,h)}).on("keyup",function(a){h.hasClass(f("Open"))?13!=a.which&&27!=a.which||e(c,h):(c.blur(),c.focus())}).on("mousedown",function(a){h.removeClass(f("Changed"))}).on("mouseup",function(b){h.hasClass(f("Open"))||(a("."+f("Open")).not(h).length>0&&"undefined"!=typeof InstallTrigger?c.focus():(h.addClass(f("Open")),b.stopPropagation(),a(document).one("mouseup."+f("Open"),function(b){b.target!=c.get(0)&&a.inArray(b.target,c.find("*").get())<0?c.blur():e(c,h)})))}).focus(function(){h.removeClass(f("Changed")).addClass(f("Focus"))}).blur(function(){h.removeClass(f("Focus")+" "+f("Open"))}).hover(function(){h.addClass(f("Hover"))},function(){h.removeClass(f("Hover"))}).trigger("update")})}})}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(c){b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("jquery")):a.jQueryBridget=b(a,a.jQuery)}(window,function(a,b){"use strict";function c(c,f,h){function i(a,b,d){var e,f="$()."+c+'("'+b+'")';return a.each(function(a,i){var j=h.data(i,c);if(!j)return void g(c+" not initialized. Cannot call methods, i.e. "+f);var k=j[b];if(!k||"_"==b.charAt(0))return void g(f+" is not a valid method");var l=k.apply(j,d);e=void 0===e?l:e}),void 0!==e?e:a}function j(a,b){a.each(function(a,d){var e=h.data(d,c);e?(e.option(b),e._init()):(e=new f(d,b),h.data(d,c,e))})}(h=h||b||a.jQuery)&&(f.prototype.option||(f.prototype.option=function(a){h.isPlainObject(a)&&(this.options=h.extend(!0,this.options,a))}),h.fn[c]=function(a){if("string"==typeof a){return i(this,a,e.call(arguments,1))}return j(this,a),this},d(h))}function d(a){!a||a&&a.bridget||(a.bridget=c)}
var e=Array.prototype.slice,f=a.console,g=void 0===f?function(){}:function(a){f.error(a)};return d(b||a.jQuery),c}),function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}(this,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{},d=c[a]=c[a]||[];return-1==d.indexOf(b)&&d.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{};return(c[a]=c[a]||{})[b]=!0,this}},b.off=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=c.indexOf(b);return-1!=d&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=0,e=c[d];b=b||[];for(var f=this._onceEvents&&this._onceEvents[a];e;){var g=f&&f[e];g&&(this.off(a,e),delete f[e]),e.apply(this,b),d+=g?0:1,e=c[d]}return this}},a}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return b()}):"object"==typeof module&&module.exports?module.exports=b():a.getSize=b()}(window,function(){"use strict";function a(a){var b=parseFloat(a);return-1==a.indexOf("%")&&!isNaN(b)&&b}function b(){}function c(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0;bc&&(this.x=0,this.y=this.maxY);var d={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+a.size.outerHeight),this.x+=b,d},c._getContainerSize=function(){return{height:this.maxY}},b}),function(a,b){"function"==typeof define&&define.amd?define("isotope/layout-modes/vertical",["../layout-mode"],b):"object"==typeof module&&module.exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("vertical",{horizontalAlignment:0}),c=b.prototype;return c._resetLayout=function(){this.y=0},c._getItemLayoutPosition=function(a){a.getSize();var b=(this.isotope.size.innerWidth-a.size.outerWidth)*this.options.horizontalAlignment,c=this.y;return this.y+=a.size.outerHeight,{x:b,y:c}},c._getContainerSize=function(){return{height:this.y}},b}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","./item","./layout-mode","./layout-modes/masonry","./layout-modes/fit-rows","./layout-modes/vertical"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)}):"object"==typeof module&&module.exports?module.exports=b(a,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):a.Isotope=b(a,a.Outlayer,a.getSize,a.matchesSelector,a.fizzyUIUtils,a.Isotope.Item,a.Isotope.LayoutMode)}(window,function(a,b,c,d,e,f,g){function h(a,b){return function(c,d){for(var e=0;eh||gh?1:-1)*j}}return 0}}function i(a){var b=a.create("fitRows");return b.prototype._resetLayout=function(){if(this.x=0,this.y=0,this.maxY=0,this.row=0,this.rows=[],this._getMeasurement("gutter","outerWidth"),this.isotope.options.equalheight)for(var a=0;ac&&(this.x=0,this.y=this.maxY),0==this.x&&0!=this.y&&this.row++;var d={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+a.size.outerHeight),this.x+=b,void 0===this.rows[this.row]?(this.rows[this.row]=[],this.rows[this.row].start=this.y,this.rows[this.row].end=this.maxY):this.rows[this.row].end=Math.max(this.rows[this.row].end,this.maxY),a.row=this.row,d},b.prototype._equalHeight=function(){for(var a=0;a
',nextButtonClass:"nav-next",nextButtonLabel:'',loadMoreButtonClass:"button-load-more",loadMoreButtonLabel:"Load more",pagerClass:"page",activeClass:"act",log:!1},h=a(this),r=b.paginationMode||i.paginationMode,s=a(b.pageControls||i.pageControls),j=a(b.filterControls||i.filterControls),k=a(b.sortControls||i.sortControls),l=a(b.orderControls||i.orderControls),m=b.controlsSelecter||i.controlsSelecter,n=b.controlsSelecterChecked||i.controlsSelecterChecked,d=1;var y=a(".phantom-sticky").exists(),z=a(".sticky-top-line").exists();if(y||z)var A=a(".masthead");else var A=a("#phantom");return q=a([]),q.$nodesCache=a([]),h.find("> article, .wf-cell").each(function(){var b=a(this);q.push({node:this,$node:b,name:b.attr("data-name"),date:new Date(b.attr("data-date"))}),q.$nodesCache.push(this)}),t=Math.ceil(q.length/b.pageLimit),p=function(){var a;"pages"!==r&&"load-more"!==r||(a=0,q.each(function(){if(this.$node.hasClass("visible"))return a++}),t=Math.ceil(a/(b.pageLimit||i.pageLimit)))},u=function(){if("pages"===r){var c,e;if(s.empty(),t>1){1!==d&&s.prepend(''+(b.previousButtonLabel||i.previousButtonLabel)+"");var f=Math.floor(2),g=Math.ceil(2),j=Math.max(d-f,1),k=d+g;j<=f&&(k=j+4),k>t&&(j=Math.max(t-4,1),k=t);var l=a(''),m=a('');for(c=e=1;1<=t?e<=t:e>=t;c=1<=t?++e:--e)c